//package com.rabbitmq.consume;
//
//import com.rabbitmq.client.Channel;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.amqp.support.AmqpHeaders;
//import org.springframework.messaging.handler.annotation.Header;
//import org.springframework.messaging.handler.annotation.Payload;
//import org.springframework.messaging.handler.annotation.SendTo;
//import org.springframework.stereotype.Component;
//
//
///**
// * @author zhangbowen
// * @date 2019/3/11
// **/
//@Component
//public class Cousume {
//    @RabbitListener(queues = "topicQueue")
//    public void receive1 (@Payload String message, @Header(AmqpHeaders.DELIVERY_TAG) long deliveryTag, Channel channel) {
//        try {
//            System.out.println(message);
//           //channel.basicAck(deliveryTag, false);
//            channel.basicNack(deliveryTag,false,true);
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//    }
//   @SendTo
//    @RabbitListener(queues = "topicQueue")
//    public String receive1 (@Payload String message) {
//        try {
//            System.out.println(message);
//            //channel.basicAck(deliveryTag, false);
//            //channel.basicNack(deliveryTag,false,true);
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//        return "wocoa ";
//    }
//}
